import log from '@dfeidao/atom-nodejs/logger/log';
import { IncomingHttpHeaders } from 'http';
import operate from '@dfeidao/atom-nodejs/db/operate';
import { systemid, productid } from '../../atom/config';
interface Message {
	post_package: string,
	post_name: string,
	page_no: 1,
	post_no: string,
}

// interface IWebResult {
// 	data: unknown;
// 	cookie?: {
// 		[name: string]: string;
// 	} | null;
// 	content_type?: string;
// 	headers?: {
// 		[key: string]: string[];
// 	};
// 	attachment?: string;
// 	redirect?: string;
// 	status_code?: number;
// }

export default async function atom(message: Message, action_id: string, session_id: string, headers: IncomingHttpHeaders) {


	const { exec, insert, } = operate(action_id, session_id, systemid);
	// 插入数据
	insert('asso_job', { productid, post_package: message.post_package, post_no: message.post_no, post_name: message.post_name });
	const ret = await exec();
	return {
		data: ret
	}
}
